"use client";
import { useErrorBoundary } from "react-error-boundary";

function Page4() {
  const { showBoundary } = useErrorBoundary();

  const onClick = () => {
    try {
      throw new Error("Page4 引发错误");
    } catch (error: any) {
      showBoundary(error);
    }
  };

  return (
    <div style={{ backgroundColor: "#FF7272" }}>
      <h3>Page4</h3>
      <button type="button" onClick={onClick}>
        按钮
      </button>
    </div>
  );
}
export default Page4;
